package siga.visao_academico;

import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import siga.banco.conexao;
import siga.pacotao.alertasSistema;
import siga.visao_busca.buscaVer;
import siga.visao.index;
import siga.visao.verErros;

public class CadastroPessoas extends javax.swing.JInternalFrame {
    List end_cidade = new ArrayList();
    List end_log_tipo = new ArrayList();
    
    /** Creates new form CadastroPessoas */
    public CadastroPessoas() {
        initComponents();
    }


    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        grespfin = new javax.swing.ButtonGroup();
        jPanel7 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        barraFerramentaFonecedor = new javax.swing.JToolBar();
        btNovo = new javax.swing.JButton();
        btAlterar = new javax.swing.JButton();
        btCancelar = new javax.swing.JButton();
        btSalvar = new javax.swing.JButton();
        btBuscar = new javax.swing.JButton();
        btSair = new javax.swing.JButton();
        JPanel = new javax.swing.JTabbedPane();
        jpEndereco = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        jtfEND_logradouro = new javax.swing.JTextField();
        jtfEND_Tipo_log = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        jtfEND_complemento = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jtfEND_bairro = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        jtfEND_estado = new javax.swing.JComboBox();
        jLabel22 = new javax.swing.JLabel();
        jtfEND_cidade = new javax.swing.JComboBox();
        jLabel23 = new javax.swing.JLabel();
        jtfEND_numero = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jtfEND_cep = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        jpContatos = new javax.swing.JPanel();
        jtfCONT_telres = new javax.swing.JFormattedTextField();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jtfCONT_telcom = new javax.swing.JFormattedTextField();
        jLabel28 = new javax.swing.JLabel();
        jtfCONT_telcel = new javax.swing.JFormattedTextField();
        jLabel29 = new javax.swing.JLabel();
        jtfCONT_email = new javax.swing.JTextField();
        jtfNmPai = new javax.swing.JTextField();
        jtfSexo = new javax.swing.JComboBox();
        jtfDtNasc = new javax.swing.JFormattedTextField();
        jtfLocNasc = new javax.swing.JTextField();
        jtfDescricao = new javax.swing.JTextField();
        jtfPortDef = new javax.swing.JComboBox();
        jtfNmMae = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jtfNacionalidade = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jtfCpf = new javax.swing.JFormattedTextField();
        jtfRG = new javax.swing.JFormattedTextField();
        jLabel10 = new javax.swing.JLabel();
        jtfDtEmissao = new javax.swing.JFormattedTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jtfOrgEmissor = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jtfTE_numero = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jtfTE_zona = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jtfTE_secao = new javax.swing.JTextField();
        jtfTE_estado = new javax.swing.JComboBox();
        jLabel16 = new javax.swing.JLabel();
        jtfTE_dtemissao = new javax.swing.JFormattedTextField();
        jLabel17 = new javax.swing.JLabel();
        jtfCodigo = new javax.swing.JTextField();

        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Cadastro de Pessoa");
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/Business_People_16x16.png"))); // NOI18N
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameClosed(evt);
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameOpened(evt);
            }
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
        });

        jPanel7.setEnabled(false);
        jPanel7.setName("jPanel7"); // NOI18N

        jLabel1.setForeground(java.awt.Color.red);
        jLabel1.setText("Nome:");
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setForeground(java.awt.Color.red);
        jLabel2.setText("Sexo:");
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setForeground(java.awt.Color.red);
        jLabel3.setText("Data de Nascimento:");
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setText("Nacionalidade:");
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setText("Local de Nascimento:");
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText("Port. Def. Física:");
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel7.setText("Nome do Pai:");
        jLabel7.setName("jLabel7"); // NOI18N

        jLabel8.setText("Nome da Mãe:");
        jLabel8.setName("jLabel8"); // NOI18N

        barraFerramentaFonecedor.setFloatable(false);
        barraFerramentaFonecedor.setRollover(true);
        barraFerramentaFonecedor.setName("barraFerramentaFonecedor"); // NOI18N

        btNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/novo_32x32.png"))); // NOI18N
        btNovo.setMnemonic('N');
        btNovo.setText("Novo");
        btNovo.setToolTipText("Inseri um Novo Cadastro");
        btNovo.setFocusable(false);
        btNovo.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btNovo.setMargin(new java.awt.Insets(2, 2, 2, 4));
        btNovo.setName("btNovo"); // NOI18N
        btNovo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btNovoActionPerformed(evt);
            }
        });
        barraFerramentaFonecedor.add(btNovo);

        btAlterar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/editar_32x32.png"))); // NOI18N
        btAlterar.setMnemonic('A');
        btAlterar.setText("Alterar");
        btAlterar.setToolTipText("Alterar um  Cadastro");
        btAlterar.setEnabled(false);
        btAlterar.setFocusable(false);
        btAlterar.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btAlterar.setMargin(new java.awt.Insets(2, 2, 2, 4));
        btAlterar.setName("btAlterar"); // NOI18N
        btAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAlterarActionPerformed(evt);
            }
        });
        barraFerramentaFonecedor.add(btAlterar);

        btCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/cancelar_32x32.png"))); // NOI18N
        btCancelar.setMnemonic('C');
        btCancelar.setText("Cancelar");
        btCancelar.setToolTipText("Cancelar um Cadastro");
        btCancelar.setEnabled(false);
        btCancelar.setFocusable(false);
        btCancelar.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btCancelar.setMargin(new java.awt.Insets(2, 2, 2, 4));
        btCancelar.setName("btCancelar"); // NOI18N
        btCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelarActionPerformed(evt);
            }
        });
        barraFerramentaFonecedor.add(btCancelar);

        btSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/salvar_32x32.png"))); // NOI18N
        btSalvar.setMnemonic('S');
        btSalvar.setText("Salvar");
        btSalvar.setToolTipText("Salvar um Cadastro");
        btSalvar.setEnabled(false);
        btSalvar.setFocusable(false);
        btSalvar.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btSalvar.setMargin(new java.awt.Insets(2, 2, 2, 4));
        btSalvar.setName("btSalvar"); // NOI18N
        btSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarActionPerformed(evt);
            }
        });
        barraFerramentaFonecedor.add(btSalvar);

        btBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/buscar_32x32.png"))); // NOI18N
        btBuscar.setText("Buscar");
        btBuscar.setToolTipText("Buscar um Cadastro");
        btBuscar.setFocusable(false);
        btBuscar.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btBuscar.setMargin(new java.awt.Insets(2, 2, 2, 4));
        btBuscar.setName("btBuscar"); // NOI18N
        btBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btBuscarActionPerformed(evt);
            }
        });
        barraFerramentaFonecedor.add(btBuscar);

        btSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sair_32x32.png"))); // NOI18N
        btSair.setMnemonic('S');
        btSair.setText("Sair");
        btSair.setToolTipText("Sair da Janela");
        btSair.setFocusable(false);
        btSair.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        btSair.setMargin(new java.awt.Insets(2, 2, 2, 4));
        btSair.setName("btSair"); // NOI18N
        btSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSairActionPerformed(evt);
            }
        });
        barraFerramentaFonecedor.add(btSair);

        JPanel.setEnabled(false);
        JPanel.setName("JPanel"); // NOI18N

        jpEndereco.setName("jpEndereco"); // NOI18N

        jLabel18.setText("Logradouro:");
        jLabel18.setName("jLabel18"); // NOI18N

        jtfEND_logradouro.setEnabled(false);
        jtfEND_logradouro.setName("jtfEND_logradouro"); // NOI18N
        jtfEND_logradouro.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtfEND_logradouroKeyReleased(evt);
            }
        });

        jtfEND_Tipo_log.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--" }));
        jtfEND_Tipo_log.setEnabled(false);
        jtfEND_Tipo_log.setName("jtfEND_Tipo_log"); // NOI18N

        jLabel19.setText("Tipo Log.:");
        jLabel19.setName("jLabel19"); // NOI18N

        jtfEND_complemento.setEnabled(false);
        jtfEND_complemento.setName("jtfEND_complemento"); // NOI18N
        jtfEND_complemento.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtfEND_complementoKeyReleased(evt);
            }
        });

        jLabel20.setText("Complemento:");
        jLabel20.setName("jLabel20"); // NOI18N

        jtfEND_bairro.setEnabled(false);
        jtfEND_bairro.setName("jtfEND_bairro"); // NOI18N
        jtfEND_bairro.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtfEND_bairroKeyReleased(evt);
            }
        });

        jLabel21.setText("Bairro:");
        jLabel21.setName("jLabel21"); // NOI18N

        jtfEND_estado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--" }));
        jtfEND_estado.setEnabled(false);
        jtfEND_estado.setName("jtfEND_estado"); // NOI18N

        jLabel22.setText("Estado:");
        jLabel22.setName("jLabel22"); // NOI18N

        jtfEND_cidade.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--" }));
        jtfEND_cidade.setEnabled(false);
        jtfEND_cidade.setName("jtfEND_cidade"); // NOI18N

        jLabel23.setText("Cidade:");
        jLabel23.setName("jLabel23"); // NOI18N

        jtfEND_numero.setEnabled(false);
        jtfEND_numero.setName("jtfEND_numero"); // NOI18N

        jLabel24.setText("Número:");
        jLabel24.setName("jLabel24"); // NOI18N

        jtfEND_cep.setEnabled(false);
        jtfEND_cep.setName("jtfEND_cep"); // NOI18N

        jLabel25.setText("CEP:");
        jLabel25.setName("jLabel25"); // NOI18N

        javax.swing.GroupLayout jpEnderecoLayout = new javax.swing.GroupLayout(jpEndereco);
        jpEndereco.setLayout(jpEnderecoLayout);
        jpEnderecoLayout.setHorizontalGroup(
            jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpEnderecoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel22)
                            .addComponent(jtfEND_estado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfEND_cidade, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel23))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel21)
                            .addComponent(jtfEND_bairro, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)))
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel19)
                            .addComponent(jtfEND_Tipo_log, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel18)
                            .addComponent(jtfEND_logradouro, javax.swing.GroupLayout.DEFAULT_SIZE, 449, Short.MAX_VALUE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel24)
                            .addComponent(jtfEND_numero, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel25)
                            .addComponent(jtfEND_cep, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jLabel20)
                    .addComponent(jtfEND_complemento))
                .addGap(424, 424, 424))
        );
        jpEnderecoLayout.setVerticalGroup(
            jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpEnderecoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addComponent(jLabel19)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEND_Tipo_log, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEND_logradouro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEND_complemento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpEnderecoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addComponent(jLabel22)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEND_estado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addComponent(jLabel23)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEND_cidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addComponent(jLabel21)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEND_bairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addComponent(jLabel24)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEND_numero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpEnderecoLayout.createSequentialGroup()
                        .addComponent(jLabel25)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfEND_cep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(149, Short.MAX_VALUE))
        );

        JPanel.addTab("Endereço", jpEndereco);

        jpContatos.setName("jpContatos"); // NOI18N

        try {
            jtfCONT_telres.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfCONT_telres.setName("jtfCONT_telres"); // NOI18N

        jLabel26.setText("Telefone Residêncial:");
        jLabel26.setName("jLabel26"); // NOI18N

        jLabel27.setText("Telefone Comercial:");
        jLabel27.setName("jLabel27"); // NOI18N

        try {
            jtfCONT_telcom.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfCONT_telcom.setName("jtfCONT_telcom"); // NOI18N

        jLabel28.setText("Telefone Celular:");
        jLabel28.setName("jLabel28"); // NOI18N

        try {
            jtfCONT_telcel.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfCONT_telcel.setName("jtfCONT_telcel"); // NOI18N

        jLabel29.setText("E-Mail:");
        jLabel29.setName("jLabel29"); // NOI18N

        jtfCONT_email.setName("jtfCONT_email"); // NOI18N

        javax.swing.GroupLayout jpContatosLayout = new javax.swing.GroupLayout(jpContatos);
        jpContatos.setLayout(jpContatosLayout);
        jpContatosLayout.setHorizontalGroup(
            jpContatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpContatosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpContatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel26)
                    .addComponent(jtfCONT_telres, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addGroup(jpContatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel27)
                    .addComponent(jtfCONT_telcom, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(35, 35, 35)
                .addGroup(jpContatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel28)
                    .addComponent(jtfCONT_telcel, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(36, 36, 36)
                .addGroup(jpContatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel29)
                    .addComponent(jtfCONT_email, javax.swing.GroupLayout.PREFERRED_SIZE, 224, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(205, Short.MAX_VALUE))
        );
        jpContatosLayout.setVerticalGroup(
            jpContatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpContatosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpContatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpContatosLayout.createSequentialGroup()
                        .addComponent(jLabel26)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfCONT_telres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpContatosLayout.createSequentialGroup()
                        .addComponent(jLabel27)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfCONT_telcom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jpContatosLayout.createSequentialGroup()
                        .addComponent(jLabel28)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jpContatosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jtfCONT_telcel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtfCONT_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jLabel29))
                .addContainerGap(195, Short.MAX_VALUE))
        );

        JPanel.addTab("Contatos", jpContatos);

        jtfNmPai.setEnabled(false);
        jtfNmPai.setName("jtfNmPai"); // NOI18N
        jtfNmPai.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtfNmPaiKeyReleased(evt);
            }
        });

        jtfSexo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--", "M", "F" }));
        jtfSexo.setEnabled(false);
        jtfSexo.setName("jtfSexo"); // NOI18N

        try {
            jtfDtNasc.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtNasc.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtNasc.setEnabled(false);
        jtfDtNasc.setName("jtfDtNasc"); // NOI18N

        jtfLocNasc.setEnabled(false);
        jtfLocNasc.setName("jtfLocNasc"); // NOI18N
        jtfLocNasc.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtfLocNascKeyReleased(evt);
            }
        });

        jtfDescricao.setEnabled(false);
        jtfDescricao.setName("jtfDescricao"); // NOI18N
        jtfDescricao.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jtfDescricaoKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtfDescricaoKeyReleased(evt);
            }
        });

        jtfPortDef.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Não", "Sim" }));
        jtfPortDef.setEnabled(false);
        jtfPortDef.setName("jtfPortDef"); // NOI18N

        jtfNmMae.setEnabled(false);
        jtfNmMae.setName("jtfNmMae"); // NOI18N
        jtfNmMae.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtfNmMaeKeyReleased(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/busca_16x16.png"))); // NOI18N
        jButton2.setEnabled(false);
        jButton2.setName("jButton2"); // NOI18N

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/busca_16x16.png"))); // NOI18N
        jButton3.setEnabled(false);
        jButton3.setName("jButton3"); // NOI18N

        jtfNacionalidade.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Brasileira", "Estrangeira" }));
        jtfNacionalidade.setEnabled(false);
        jtfNacionalidade.setName("jtfNacionalidade"); // NOI18N

        jLabel9.setText("CPF:");
        jLabel9.setName("jLabel9"); // NOI18N

        try {
            jtfCpf.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfCpf.setEnabled(false);
        jtfCpf.setName("jtfCpf"); // NOI18N

        try {
            jtfRG.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfRG.setEnabled(false);
        jtfRG.setName("jtfRG"); // NOI18N

        jLabel10.setForeground(java.awt.Color.red);
        jLabel10.setText("RG:");
        jLabel10.setName("jLabel10"); // NOI18N

        try {
            jtfDtEmissao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtEmissao.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtEmissao.setEnabled(false);
        jtfDtEmissao.setName("jtfDtEmissao"); // NOI18N

        jLabel11.setText("Data de Emissão:");
        jLabel11.setName("jLabel11"); // NOI18N

        jLabel12.setText("Órgão Emissor:");
        jLabel12.setName("jLabel12"); // NOI18N

        jtfOrgEmissor.setEnabled(false);
        jtfOrgEmissor.setName("jtfOrgEmissor"); // NOI18N
        jtfOrgEmissor.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jtfOrgEmissorKeyReleased(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Titulo Eleitoral"));
        jPanel1.setName("jPanel1"); // NOI18N

        jtfTE_numero.setEnabled(false);
        jtfTE_numero.setName("jtfTE_numero"); // NOI18N

        jLabel13.setText("Número:");
        jLabel13.setName("jLabel13"); // NOI18N

        jLabel14.setText("Zona:");
        jLabel14.setName("jLabel14"); // NOI18N

        jtfTE_zona.setEnabled(false);
        jtfTE_zona.setName("jtfTE_zona"); // NOI18N

        jLabel15.setText("Seção:");
        jLabel15.setName("jLabel15"); // NOI18N

        jtfTE_secao.setEnabled(false);
        jtfTE_secao.setName("jtfTE_secao"); // NOI18N

        jtfTE_estado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "--" }));
        jtfTE_estado.setEnabled(false);
        jtfTE_estado.setName("jtfTE_estado"); // NOI18N

        jLabel16.setText("UF Eleitoral:");
        jLabel16.setName("jLabel16"); // NOI18N

        try {
            jtfTE_dtemissao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfTE_dtemissao.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfTE_dtemissao.setEnabled(false);
        jtfTE_dtemissao.setName("jtfTE_dtemissao"); // NOI18N

        jLabel17.setText("Data de Emissão:");
        jLabel17.setName("jLabel17"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jtfTE_numero, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jtfTE_zona, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel15)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jtfTE_secao, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel16)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jtfTE_estado, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(jtfTE_dtemissao)
                                            .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfTE_dtemissao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfTE_estado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfTE_secao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfTE_zona, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfTE_numero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jtfCodigo.setEditable(false);
        jtfCodigo.setName("jtfCodigo"); // NOI18N

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jtfLocNasc, javax.swing.GroupLayout.PREFERRED_SIZE, 363, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jtfNacionalidade, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel4)))
                    .addComponent(jLabel1)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jtfNmPai, javax.swing.GroupLayout.PREFERRED_SIZE, 376, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jtfNmMae, javax.swing.GroupLayout.PREFERRED_SIZE, 376, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jtfPortDef, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jtfDtNasc, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel9)
                                    .addComponent(jtfCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel10)
                                    .addComponent(jtfRG, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jtfOrgEmissor, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jtfDtEmissao)
                                    .addComponent(jLabel11)))))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jtfCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, 613, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2)))
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(198, Short.MAX_VALUE))
            .addComponent(barraFerramentaFonecedor, javax.swing.GroupLayout.DEFAULT_SIZE, 945, Short.MAX_VALUE)
            .addComponent(JPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 945, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(barraFerramentaFonecedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(14, 14, 14)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(26, 26, 26))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jtfSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtfDescricao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jtfCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButton2)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfNmPai, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButton3)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfNmMae, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfPortDef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfDtNasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel9)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfRG, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel12)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfOrgEmissor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jLabel11)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtfDtEmissao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfLocNasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jtfNacionalidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addGap(26, 26, 26)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(JPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btNovoActionPerformed
        btSalvar.setEnabled(!btSalvar.isEnabled());
        btCancelar.setEnabled(!btCancelar.isEnabled());
        btNovo.setEnabled(!btNovo.isEnabled());
        btAlterar.setEnabled(false);
        btBuscar.setEnabled(!btBuscar.isEnabled());
        gerenciaCampos();
        LimpaCampos();
        conexao.AutoIncrementa("pessoas");
        jtfCodigo.setText(conexao.AutoIncRS);
        this.setTitle("Cadastro de Pessoa :: Código:" + conexao.AutoIncRS);
        
}//GEN-LAST:event_btNovoActionPerformed

    private void btAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAlterarActionPerformed
        btBuscar.setEnabled(!btBuscar.isEnabled());
        gerenciaBotao();
        gerenciaCampos();
}//GEN-LAST:event_btAlterarActionPerformed

    private void btCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelarActionPerformed
        if(btCancelar.isEnabled()){
            if(!btNovo.isEnabled()){
                btSalvar.setEnabled(!btSalvar.isEnabled());
                btCancelar.setEnabled(!btCancelar.isEnabled());
                btNovo.setEnabled(!btNovo.isEnabled());
                btBuscar.setEnabled(!btBuscar.isEnabled());
            }else{
                gerenciaBotao();
            }
            conexao.RemoveAutoIncrementa("pessoas");
            this.setTitle("Cadastro de Pessoa");
            gerenciaCampos();
            LimpaCampos();
        }
}//GEN-LAST:event_btCancelarActionPerformed

    private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
       if(!jtfDescricao.getText().isEmpty()&&jtfSexo.getSelectedIndex()!=0&&!jtfDtNasc.getText().equals("  /  /    ")&&!jtfRG.getText().equals("   .   .   ")){
            try {
                String dados = "";
                String campos = "";
                dados = jtfCodigo.getText();
                campos = "codigo";
                dados += "," + index.cod_emp;
                campos += ",cod_emp";
                dados += ",\"Pessoa\"";
                campos += ",tipo";
                dados += (!jtfDescricao.getText().isEmpty()) ? ",\"" + jtfDescricao.getText() + "\"" : "";
                campos += (!jtfDescricao.getText().isEmpty()) ? ",descricao" : "";
                dados += (jtfSexo.getSelectedIndex() != 0) ? "," + jtfSexo.getSelectedIndex() : "";
                campos += (jtfSexo.getSelectedIndex() != 0) ? ",sexo" : "";
                dados += (jtfPortDef.getSelectedIndex() != 0) ? ",\"" + jtfPortDef.getSelectedItem() + "\"" : "";
                campos += (jtfPortDef.getSelectedIndex() != 0) ? ",port_def" : "";
                dados += (!jtfDtNasc.getText().equals("  /  /    ")) ? ",\"" + new SimpleDateFormat("yyyy-MM-dd").format(new SimpleDateFormat("dd/MM/yyyy").parse(jtfDtNasc.getText())) + "\"" : "";
                campos += (!jtfDtNasc.getText().equals("  /  /    ")) ? ",dt_nasc" : "";
                dados += (!jtfCpf.getText().equals("   .   .   -  ")) ? ",\"" + jtfCpf.getText() + "\"" : "";
                campos += (!jtfCpf.getText().equals("   .   .   -  ")) ? ",cpf" : "";
                dados += (!jtfRG.getText().equals("   .   .   ")) ? ",\"" + jtfRG.getText() + "\"" : "";
                campos += (!jtfRG.getText().equals("   .   .   ")) ? ",rg" : "";
                dados += (!jtfOrgEmissor.getText().isEmpty()) ? ",\"" + jtfOrgEmissor.getText() + "\"" : "";
                campos += (!jtfOrgEmissor.getText().isEmpty()) ? ",org_emissor" : "";
                dados += (!jtfDtEmissao.getText().equals("  /  /    ")) ? ",\"" + new SimpleDateFormat("yyyy-MM-dd").format(new SimpleDateFormat("dd/MM/yyyy").parse(jtfDtNasc.getText())) + "\"" : "";
                campos += (!jtfDtEmissao.getText().equals("  /  /    ")) ? ",dt_rg" : "";
                dados += (!jtfLocNasc.getText().isEmpty()) ? ",\"" + jtfLocNasc.getText() + "\"" : "";
                campos += (!jtfLocNasc.getText().isEmpty()) ? ",loc_nasc" : "";
                dados += (jtfNacionalidade.getSelectedIndex() != 0) ? ",\"" + jtfNacionalidade.getSelectedItem() + "\"" : "";
                campos += (jtfNacionalidade.getSelectedIndex() != 0) ? ",nacionalidade" : "";
                dados += (!jtfTE_numero.getText().isEmpty()) ? ",\"" + jtfTE_numero.getText() + "\"" : "";
                campos += (!jtfTE_numero.getText().isEmpty()) ? ",nro_titulo" : "";
                dados += (!jtfTE_zona.getText().isEmpty()) ? ",\"" + jtfTE_zona.getText() + "\"" : "";
                campos += (!jtfTE_zona.getText().isEmpty()) ? ",zona_titulo" : "";
                dados += (!jtfTE_secao.getText().isEmpty()) ? ",\"" + jtfTE_secao.getText() + "\"" : "";
                campos += (!jtfTE_secao.getText().isEmpty()) ? ",secao_titulo" : "";
                dados += (jtfTE_estado.getSelectedIndex() != 0) ? ",\"" + jtfTE_estado.getSelectedItem() + "\"" : "\"";
                campos += (jtfTE_estado.getSelectedIndex() != 0) ? ",estado_titulo" : "";
                dados += (!jtfTE_dtemissao.getText().equals("  /  /    ")) ? ",\"" + new SimpleDateFormat("yyyy-MM-dd").format(new SimpleDateFormat("dd/MM/yyyy").parse(jtfTE_dtemissao.getText())) + "\"" : "";
                campos += (!jtfTE_dtemissao.getText().equals("  /  /    ")) ? ",dt_titulo" : "";
                dados += (jtfEND_Tipo_log.getSelectedIndex() != 0) ? "," + end_log_tipo.get(jtfEND_Tipo_log.getSelectedIndex()) : "";
                campos += (jtfEND_Tipo_log.getSelectedIndex() != 0) ? ",tipo_log" : "";
                dados += (!jtfEND_logradouro.getText().isEmpty()) ? ",\"" + jtfEND_logradouro.getText() + "\"" : "";
                campos += (!jtfEND_logradouro.getText().isEmpty()) ? ",logradouro" : "";
                dados += (!jtfEND_complemento.getText().isEmpty()) ? ",\"" + jtfEND_complemento.getText() + "\"" : "";
                campos += (!jtfEND_complemento.getText().isEmpty()) ? ",comp_log" : "";
                dados += (jtfEND_cidade.getSelectedIndex() != 0) ? "," + end_cidade.get(jtfEND_cidade.getSelectedIndex()) : "";
                campos += (jtfEND_cidade.getSelectedIndex() != 0) ? ",cod_cidade" : "";
                dados += (!jtfEND_bairro.getText().isEmpty()) ? ",\"" + jtfEND_bairro.getText() + "\"" : "";
                campos += (!jtfEND_bairro.getText().isEmpty()) ? ",bairro" : "";
                dados += (!jtfEND_numero.getText().isEmpty()) ? ",\"" + jtfEND_numero.getText() + "\"" : "";
                campos += (!jtfEND_numero.getText().isEmpty()) ? ",nro_log" : "";
                dados += (!jtfEND_cep.getText().isEmpty()) ? ",\"" + jtfEND_cep.getText() + "\"" : "";
                campos += (!jtfEND_cep.getText().isEmpty()) ? ",cep" : "";
                dados += (!jtfCONT_telres.getText().equals("(  )    -    ")) ? ",\"" + jtfCONT_telres.getText() + "\"" : "";
                campos += (!jtfCONT_telres.getText().equals("(  )    -    ")) ? ",telefone" : "";
                dados += (!jtfCONT_telcom.getText().equals("(  )    -    ")) ? ",\"" + jtfCONT_telcom.getText() + "\"" : "";
                campos += (!jtfCONT_telcom.getText().equals("(  )    -    ")) ? ",telefone_com" : "";
                dados += (!jtfCONT_telcel.getText().equals("(  )    -    ")) ? ",\"" + jtfCONT_telcel.getText() + "\"" : "";
                campos += (!jtfCONT_telcel.getText().equals("(  )    -    ")) ? ",celular" : "";
                dados += (!jtfCONT_email.getText().isEmpty()) ? ",\"" + jtfCONT_email.getText() + "\"" : "";
                campos += (!jtfCONT_email.getText().isEmpty()) ? ",login" : "";
                conexao.Inserir("replace into pessoas (" + campos + ") values(" + dados + ")");
                gerenciaBotao();
                btBuscar.setEnabled(!btBuscar.isEnabled());
                gerenciaCampos();
            } catch (ParseException ex) {
                verErros.setErro(ex.getMessage());
            }
       }else{
           alertasSistema.alertaPermissao();
       }
}//GEN-LAST:event_btSalvarActionPerformed

    @SuppressWarnings("static-access")
    private void btBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btBuscarActionPerformed
        buscaVer bt = new buscaVer(null,true);
        bt.setTipo("Pessoa");
        bt.setLocation((index.tela.width-bt.getWidth())/2, (index.tela.height-bt.getHeight())/2);
        bt.setVisible(true);
        if(bt.isConfirmaBusca()){
            gerenciaBusca(index.LRpessoa.get(0).toString());
            index.LRpessoa.clear();
            btAlterar.setEnabled(true);
        }
}//GEN-LAST:event_btBuscarActionPerformed

    private void btSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSairActionPerformed
        btCancelarActionPerformed(evt);
        setVisible(false);
        dispose();
}//GEN-LAST:event_btSairActionPerformed

    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened
        CampoEstadoCarrega(jtfTE_estado);
        CampoEstadoCarrega(jtfEND_estado);
        CampoCidadeCarrega(jtfEND_cidade, end_cidade,jtfEND_estado);
        CampoLogradouroCarrega(jtfEND_Tipo_log, end_log_tipo);
    }//GEN-LAST:event_formInternalFrameOpened

    private void formInternalFrameClosed(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameClosed
        if(btCancelar.isEnabled()){
            if(!btNovo.isEnabled()){
                btSalvar.setEnabled(!btSalvar.isEnabled());
                btCancelar.setEnabled(!btCancelar.isEnabled());
                btNovo.setEnabled(!btNovo.isEnabled());
            }else{
                gerenciaBotao();
            }
            conexao.RemoveAutoIncrementa("pessoas");
            this.setTitle("Cadastro de Pessoa");
            gerenciaCampos();
            LimpaCampos();
        }
    }//GEN-LAST:event_formInternalFrameClosed

private void jtfDescricaoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfDescricaoKeyPressed
    
}//GEN-LAST:event_jtfDescricaoKeyPressed

private void jtfDescricaoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfDescricaoKeyReleased
    index.maiusculo(jtfDescricao, evt);
}//GEN-LAST:event_jtfDescricaoKeyReleased

private void jtfNmPaiKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfNmPaiKeyReleased
    index.maiusculo(jtfNmPai, evt);
}//GEN-LAST:event_jtfNmPaiKeyReleased

private void jtfNmMaeKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfNmMaeKeyReleased
    index.maiusculo(jtfNmMae, evt);
}//GEN-LAST:event_jtfNmMaeKeyReleased

private void jtfLocNascKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfLocNascKeyReleased
    index.maiusculo(jtfLocNasc, evt);
}//GEN-LAST:event_jtfLocNascKeyReleased

private void jtfOrgEmissorKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfOrgEmissorKeyReleased
    index.maiusculo(jtfOrgEmissor, evt);
}//GEN-LAST:event_jtfOrgEmissorKeyReleased

private void jtfEND_logradouroKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfEND_logradouroKeyReleased
    index.maiusculo(jtfEND_logradouro, evt);
}//GEN-LAST:event_jtfEND_logradouroKeyReleased

private void jtfEND_complementoKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfEND_complementoKeyReleased
    index.maiusculo(jtfEND_logradouro, evt);
}//GEN-LAST:event_jtfEND_complementoKeyReleased

private void jtfEND_bairroKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtfEND_bairroKeyReleased
    index.maiusculo(jtfEND_bairro, evt);
}//GEN-LAST:event_jtfEND_bairroKeyReleased




     private void gerenciaBotao(){
        btNovo.setEnabled(!btNovo.isEnabled());
        btAlterar.setEnabled(!btAlterar.isEnabled());
        btCancelar.setEnabled(!btCancelar.isEnabled());
        btSalvar.setEnabled(!btSalvar.isEnabled());
    }

    private void gerenciaCampos(){
        JPanel.setEnabled(!jtfDescricao.isEnabled());
        jtfPortDef.setEnabled(!jtfDescricao.isEnabled());
        jtfEND_estado.setEnabled(!jtfDescricao.isEnabled());
        jtfEND_cidade.setEnabled(!jtfDescricao.isEnabled());
        jtfEND_Tipo_log.setEnabled(!jtfDescricao.isEnabled());
        jtfEND_bairro.setEnabled(!jtfDescricao.isEnabled());
        jtfEND_cep.setEnabled(!jtfDescricao.isEnabled());
        jtfEND_complemento.setEnabled(!jtfDescricao.isEnabled());
        jtfEND_logradouro.setEnabled(!jtfDescricao.isEnabled());
        jtfEND_numero.setEnabled(!jtfDescricao.isEnabled());
        jtfTE_dtemissao.setEnabled(!jtfDescricao.isEnabled());
        jtfTE_secao.setEnabled(!jtfDescricao.isEnabled());
        jtfTE_zona.setEnabled(!jtfDescricao.isEnabled());
        jtfTE_estado.setEnabled(!jtfDescricao.isEnabled());
        jtfTE_numero.setEnabled(!jtfDescricao.isEnabled());
        jtfDtEmissao.setEnabled(!jtfDescricao.isEnabled());
        jtfOrgEmissor.setEnabled(!jtfDescricao.isEnabled());
        jtfRG.setEnabled(!jtfDescricao.isEnabled());
        jtfCpf.setEnabled(!jtfDescricao.isEnabled());
        jtfNacionalidade.setEnabled(!jtfDescricao.isEnabled());
        jtfLocNasc.setEnabled(!jtfDescricao.isEnabled());
        //jtfNmMae.setEnabled(!jtfDescricao.isEnabled());
        //jtfNmPai.setEnabled(!jtfDescricao.isEnabled());
        jtfDtNasc.setEnabled(!jtfDescricao.isEnabled());
        jtfSexo.setEnabled(!jtfDescricao.isEnabled());
        jtfCpf.setEnabled(!jtfDescricao.isEnabled());
        jtfDescricao.setEnabled(!jtfDescricao.isEnabled());
        jtfDescricao.requestFocus();
    }

    private void LimpaCampos(){
        jtfCodigo.setText("");
        jtfDescricao.setText("");
        jtfSexo.setSelectedIndex(0);
        jtfPortDef.setSelectedItem("");
        jtfDtNasc.setText("");
        jtfCpf.setText("");
        jtfRG.setText("");
        jtfOrgEmissor.setText("");
        jtfDtNasc.setText("");
        jtfLocNasc.setText("");
        jtfNacionalidade.setSelectedItem("");
        jtfTE_numero.setText("");
        jtfTE_zona.setText("");
        jtfTE_secao.setText("");
        jtfTE_estado.setSelectedItem("");
        jtfTE_dtemissao.setText("");
        jtfEND_Tipo_log.setSelectedIndex(0);
        jtfEND_logradouro.setText("");
        jtfEND_complemento.setText("");
        jtfEND_cidade.setSelectedIndex(0);
        jtfEND_bairro.setText("");
        jtfEND_numero.setText("");
        jtfEND_cep.setText("");
        jtfCONT_telres.setText("");
        jtfCONT_telcom.setText("");
        jtfCONT_telcel.setText("");
        jtfCONT_email.setText("");
    }

    private void gerenciaBusca(String codigo){
        try {
            conexao.Query("select * from pessoas where codigo=" + codigo + " and cod_emp=" + index.cod_emp+" ");
            conexao.res().next();
            jtfCodigo.setText(conexao.res().getString("codigo"));
            jtfDescricao.setText(conexao.res().getString("descricao"));
            jtfSexo.setSelectedItem(conexao.res().getString("sexo"));
            jtfPortDef.setSelectedItem(conexao.res().getString("port_def"));
            jtfDtNasc.setText((conexao.res().getString("dt_nasc")!=null)? new SimpleDateFormat("dd/MM/yyyy").format(new SimpleDateFormat("yyyy-MM-dd").parse(conexao.res().getString("dt_nasc"))):"");
            jtfCpf.setText(conexao.res().getString("cpf"));
            jtfRG.setText(conexao.res().getString("rg"));
            jtfOrgEmissor.setText(conexao.res().getString("org_emissor"));
            jtfDtNasc.setText(conexao.res().getString("dt_nasc"));
            jtfLocNasc.setText(conexao.res().getString("loc_nasc"));
            jtfNacionalidade.setSelectedItem(conexao.res().getString("nacionalidade"));
            jtfTE_numero.setText(conexao.res().getString("nro_titulo"));
            jtfTE_zona.setText(conexao.res().getString("zona_titulo"));
            jtfTE_secao.setText(conexao.res().getString("secao_titulo"));
            jtfTE_estado.setSelectedItem(conexao.res().getString("estado_titulo"));
            jtfTE_dtemissao.setText((conexao.res().getString("dt_titulo")!=null)?new SimpleDateFormat("dd/MM/yyyy").format(new SimpleDateFormat("yyyy-MM-dd").parse(conexao.res().getString("dt_titulo"))):"");
            //jtfEND_Tipo_log.setSelectedIndex(end_log_tipo.get(conexao.res().getInt("tipo_log")));
            jtfEND_logradouro.setText(conexao.res().getString("logradouro"));
            jtfEND_complemento.setText(conexao.res().getString("nro_log"));
            //jtfEND_cidade.setSelectedIndex(end_cidade.get(conexao.res().getInt("cod_cidade")));
            jtfEND_bairro.setText(conexao.res().getString("bairro"));
            jtfEND_numero.setText(conexao.res().getString("nro_log"));
            jtfEND_cep.setText(conexao.res().getString("cep"));
            jtfCONT_telres.setText(conexao.res().getString("telefone"));
            jtfCONT_telcom.setText(conexao.res().getString("telefone_com"));
            jtfCONT_telcel.setText(conexao.res().getString("celular"));
            jtfCONT_email.setText(conexao.res().getString("email"));
        } catch (ParseException ex) {
            verErros.setErro(ex.getMessage());
        } catch (SQLException ex) {
            verErros.setErro(ex.getMessage());
        }
    }

    private void CampoEstadoCarrega(JComboBox obj){
        try {
            conexao.Query("select codigo, sigla from end_estados order by sigla");
            obj.removeAllItems();
            while (conexao.rs.next()) {
                obj.addItem(conexao.rs.getString("sigla"));
            }
            obj.setSelectedItem("SC");
        } catch (SQLException ex) {
            verErros.setErro(ex.getMessage());
        }
    }

    private void CampoCidadeCarrega(JComboBox obj, List obj2, JComboBox obj3){
        try {
            conexao.Query("select codigo, descricao from end_cidade where sigla=\"" + obj3.getSelectedItem() + "\" order by descricao");
            obj.removeAllItems();
            obj2.removeAll(obj2);
            while (conexao.rs.next()) {
                obj2.add(conexao.rs.getString("codigo"));
                obj.addItem(conexao.rs.getString("descricao"));
            }
            obj.setSelectedItem("TUBARAO");
        } catch (SQLException ex) {
            verErros.setErro(ex.getMessage());
        }
    }

    private void CampoLogradouroCarrega(JComboBox obj, List obj2){
        try {
            conexao.Query("select codigo, descricao from end_tipo order by descricao");
            obj.removeAllItems();
            obj2.removeAll(obj2);
            while (conexao.rs.next()) {
                obj2.add(conexao.rs.getString("codigo"));
                obj.addItem(conexao.rs.getString("descricao"));
            }
            obj.setSelectedItem("Rua");
        } catch (SQLException ex) {
            verErros.setErro(ex.getMessage());
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane JPanel;
    private javax.swing.JToolBar barraFerramentaFonecedor;
    private javax.swing.JButton btAlterar;
    private javax.swing.JButton btBuscar;
    private javax.swing.JButton btCancelar;
    private javax.swing.JButton btNovo;
    private javax.swing.JButton btSair;
    private javax.swing.JButton btSalvar;
    private javax.swing.ButtonGroup grespfin;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jpContatos;
    private javax.swing.JPanel jpEndereco;
    private javax.swing.JTextField jtfCONT_email;
    private javax.swing.JFormattedTextField jtfCONT_telcel;
    private javax.swing.JFormattedTextField jtfCONT_telcom;
    private javax.swing.JFormattedTextField jtfCONT_telres;
    private javax.swing.JTextField jtfCodigo;
    private javax.swing.JFormattedTextField jtfCpf;
    private javax.swing.JTextField jtfDescricao;
    private javax.swing.JFormattedTextField jtfDtEmissao;
    private javax.swing.JFormattedTextField jtfDtNasc;
    private javax.swing.JComboBox jtfEND_Tipo_log;
    private javax.swing.JTextField jtfEND_bairro;
    private javax.swing.JTextField jtfEND_cep;
    private javax.swing.JComboBox jtfEND_cidade;
    private javax.swing.JTextField jtfEND_complemento;
    private javax.swing.JComboBox jtfEND_estado;
    private javax.swing.JTextField jtfEND_logradouro;
    private javax.swing.JTextField jtfEND_numero;
    private javax.swing.JTextField jtfLocNasc;
    private javax.swing.JComboBox jtfNacionalidade;
    private javax.swing.JTextField jtfNmMae;
    private javax.swing.JTextField jtfNmPai;
    private javax.swing.JTextField jtfOrgEmissor;
    private javax.swing.JComboBox jtfPortDef;
    private javax.swing.JFormattedTextField jtfRG;
    private javax.swing.JComboBox jtfSexo;
    private javax.swing.JFormattedTextField jtfTE_dtemissao;
    private javax.swing.JComboBox jtfTE_estado;
    private javax.swing.JTextField jtfTE_numero;
    private javax.swing.JTextField jtfTE_secao;
    private javax.swing.JTextField jtfTE_zona;
    // End of variables declaration//GEN-END:variables

}
